import { lazy } from "react";
import {
  AppOutline,
  AppstoreOutline,
  MessageOutline,
  UserContactOutline
} from 'antd-mobile-icons'

let Home = lazy(() => import('../pages/home'))
let Login = lazy(() => import('../pages/login'))
let Error = lazy(() => import('../pages/404'))
let Index = lazy(() => import('../pages/index'))
let Message = lazy(() => import('../pages/message'))
let Classify = lazy(() => import('../pages/classify'))
let My = lazy(() => import('../pages/my'))

export let homeRouter = [
  {
    path: '/',
    element: <Index></Index>,
    title: '首页',
    icon: <AppOutline />
  },
  {
    path: '/classify',
    element: <Classify></Classify>,
    title: '分类',
    icon: <AppstoreOutline />
  },
  {
    path: '/message',
    element: <Message></Message>,
    title: '消息',
    icon: <MessageOutline />
  },
  {
    path: '/my',
    element: <My></My>,
    title: '我的',
    icon: <UserContactOutline />
  },
]

export let routers = [
  {
    path:'/',
    element:<Home></Home>,
    children:homeRouter
  },
  {
    path:'login',
    element:<Login></Login>
  },
  {
    path:'*',
    element:<Error></Error>
  }
]